Reduce allocation size in test Gather_oveflow_check from 4GiB to >2GiB#27483
Reduce allocation size in test Gather_oveflow_check from 4GiB to >2GiB#27483adrianlizarraga merged 4 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR reduces the memory allocation in the Gather_overflow_check test from ~4GiB to ~2.1GiB while maintaining the test's effectiveness in verifying the integer overflow fix from PR #27444. The test validates that the CPU Gather operator correctly handles output tensors with dimensions that exceed INT32_MAX.
Changes:
- Reduced test dimension from 65537 to 46341 (output shape from 65537×65537 to 46341×46341)
- Updated comments to reflect the new dimensions and calculation (2,147,488,281 elements, just over INT32_MAX)
- Removed the 32-bit platform skip since the new allocation size no longer overflows size_t on 32-bit platforms
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ize. Increase Android emulator memory to 5GiB
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
#27483) ### Description This PR reduces the size of the memory allocation for expected outputs from ~4GiB to ~2GiB in the Gather_overflow_check test. The updated test still verifies that the integer overflow fix from PR #27444 is valid. That is, that the CPU Gather operator correctly handles output tensors with element counts that exceed INT32_MAX. Changes: - Reduced test dimension from 65537 to 46341 (output shape from 65537×65537 to 46341×46341), which results in a total number of elements that is just over INT32_MAX, which is required to test the bug fix. - The peak memory usage is reduced to ~4GiB + overhead. - Increase Android emulator memory to 5GiB (from 4GiB) to be able to run the test. ### Motivation Android CI fails to run the unit test introduced in #27444 due to memory usage that exceeds the Android emulator's default memory of 4GiB. This PR lowers the peak memory usage of the unit test and increases the Android emulator's memory by 1GiB.
This cherry-picks the following commits for the release: | Commit ID | PR Number | Commit Title | |-----------|-----------|-------------| | 2604d31 | #27480 | Move JAR testing pipelines to canonical pipeline template | | 0768f42 | #27483 | Reduce allocation size in test Gather_oveflow_check from 4GiB to >2GiB | --------- Co-authored-by: eserscor <erscor@microsoft.com> Co-authored-by: Adrian Lizarraga <adlizarraga@microsoft.com>
Description
This PR reduces the size of the memory allocation for expected outputs from ~4GiB to ~2GiB in the Gather_overflow_check test. The updated test still verifies that the integer overflow fix from PR #27444 is valid. That is, that the CPU Gather operator correctly handles output tensors with element counts that exceed INT32_MAX.
Changes:
Motivation
Android CI fails to run the unit test introduced in #27444 due to memory usage that exceeds the Android emulator's default memory of 4GiB. This PR lowers the peak memory usage of the unit test and increases the Android emulator's memory by 1GiB.